package com.maxd.bean.user;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@ApiModel("积分调整请求")
@Data
public class AdjustPromotePointReq {

    @ApiModelProperty("用户ID")
    @NotNull(message = "用户ID不能为空")
    private Long userId;

    @ApiModelProperty("操作类型 GEN-增加 USE-减少")
    @NotBlank(message = "操作类型不能为空")
    @Pattern(regexp = "GEN|USE", message = "操作类型输入不正确")
    private String operation;

    @ApiModelProperty("数量")
    @NotNull(message = "数量不能为空")
    @Min(value = 1, message = "调整数量必须大于0")
    private Integer number;

    @ApiModelProperty("备注")
    @Length(max = 200, message = "备注长度不能超过200")
    private String remark;

}
